package cn.schoolwow.workflow.module.instance.action.kit;

import cn.schoolwow.workflow.domain.instance.StartWorkFlowRequest;
import cn.schoolwow.workflow.domain.instance.WorkFlowInstanceQuery;
import cn.schoolwow.workflow.entity.WorkFlowInstance;
import com.alibaba.fastjson.JSONObject;

public interface WorkFlowInstanceActionService {
    /**
     * 启动工作流实例
     * @param definitionName 工作流定义名称
     * */
    WorkFlowInstance startWorkFlow(String definitionName);

    /**
     * 启动工作流实例
     * @param startWorkFlowRequest 启动工作流请求
     * */
    WorkFlowInstance startWorkFlow(StartWorkFlowRequest startWorkFlowRequest);

    /**
     * 撤销工作流实例
     * @param workFlowInstanceId 工作流实例id
     * */
    void revokeWorkFlowInstance(Long workFlowInstanceId);

    /**
     * 撤销工作流实例
     * @param workFlowInstanceQuery 工作流实例查询条件
     * */
    void revokeWorkFlowInstance(WorkFlowInstanceQuery workFlowInstanceQuery);

    /**
     * 更新工作流实例上下文数据
     * @param workFlowInstanceId 工作流实例id
     * */
    void updateWorkFlowInstanceContextData(Long workFlowInstanceId, JSONObject contextData);

    /**
     * 删除工作流实例
     * @param workFlowInstanceId 工作流实例id
     * */
    void deleteWorkFlowInstance(Long workFlowInstanceId);

    /**
     * 删除工作流实例
     * @param workFlowInstanceQuery 删除工作流实例请求
     * */
    void deleteWorkFlowInstance(WorkFlowInstanceQuery workFlowInstanceQuery);
}
